{% extends 'draft/draft_base.html' %}
{% load static %}
{% block title%}发版草稿填写{% endblock title%}

{% block content %}
    {% if error %}
        <p>{{ error }}</p>
    {% else %}
    <div class="mt-6"></div>
    <div class="body-container ml-auto mr-auto ">
        <h2 class="is-size-3 mb-4 mt-2 has-text-centered"> 发版草稿 </h2>
        <form method="post">
            {% csrf_token %}
            {# 发行版本号 #}
            <div class="draft_title field is-horizontal  pb-5">
                <div class="field-label  is-normal">
                    <label class="is-size-6 has-text-centered" style="display: block ruby">产品名称:</label>
                </div>
                <div class="field-body">
                    <div class="field">
                        <p class="control is-expanded" style="width: 70%">
                            {{ form.product_name }}
                            <span style="color: red;"> {{ form.product_name.errors.0 }} </span>
                        </p>
                    </div>
                </div>
                <div class="field-label  is-normal ">
                    <label class="is-size-6 has-text-centered">版本号:</label>
                </div>
                <div class="field-body ">
                    <div class="field">
                        <p class="control" style="width: 70%">
                            {{ form.release_version }}
                            <span style="color: red;"> {{ form.release_version.errors.0 }} </span>
                        </p>
                    </div>
                </div>
            </div>
            {#  发版内容 #}
            <div class="draft_body field ">
                {#  发行说明  #}
                <div class="release_note mt-4 field">
                    <label class="is-size-6">发版说明</label>
                    <div class="item_container field">
                        {{ form.release_remarks }}
                        <span style="color: red;"> {{ form.release_remarks.errors.0 }} </span>
                    </div>
                </div>
                {#  添加或更改功能  #}
                <div class="update_functions mt-5 field">
                    <label class="is-size-6">添加或更改功能</label>
                    <div class="item_container field">
                        <label class="is-size-8"> - Front </label>
                        {{ form.update_front }}
                        <span style="color: red;"> {{ form.update_front.errors.0 }} </span>
                        <label class="is-size-8"> - Back </label>
                        {{ form.update_back }}
                        <span style="color: red;"> {{ form.update_back.errors.0 }} </span>
                    </div>
                </div>
                {#  修复的bug  #}
                <div class="fix_bug mt-5 field">
                    <label class="is-size-6">修复的Bug</label>
                    <div class="item_container field">
                        <label class="is-size-8"> - Front </label>
                        {{ form.fixed_front }}
                        <span style="color: red;"> {{ form.fixed_front.errors.0 }} </span>
                        <label class="is-size-8"> - Back </label>
                        {{ form.fixed_back }}
                        <span style="color: red;"> {{ form.fixed_back.errors.0 }} </span>
                    </div>
                </div>
                {#  Commit hash  #}
                <div class="commit_hash mt-5 field">
                    <label class="is-size-6">Commit hash</label>
                    <div class="item_container field">
                        <div class=" field is-horizontal  pb-6">
                            <div class="field-label  is-normal">
                                <label class="is-size-6 has-text-centered">Front hash:</label>
                            </div>
                            <div class="field-body">
                                <div class="field">
                                    <p class="control">
                                        {{ form.hash_front }}
                                        <span style="color: red;"> {{ form.hash_front.errors.0 }} </span>
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="item_container field">
                        <div class=" field is-horizontal  pb-6">
                            <div class="field-label  is-normal">
                                <label class="is-size-6 has-text-centered">Back hash:</label>
                            </div>
                            <div class="field-body">
                                <div class="field">
                                    <p class="control">
                                        {{ form.hash_back }}
                                        <span style="color: red;"> {{ form.hash_back.errors.0 }} </span>
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="field mt-1 has-text-centered">
                <div class="columns is-mobile">
                    <div class="column control column is-4 is-offset-8">
                        <a class="back-list button is-link " href="{% url 'draft_list' %}"> 返回 </a>
                        <button class="button is-primary " type="submit"> 修改 </button>
                    </div>
                </div>
            </div>
        </form>
    </div>
    {% endif %}
{% endblock content %}